<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
<h:head>
    <title>index</title>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
    <h:outputStylesheet library="css" name="table-style.css"/>
    <f:view locale="#{userBean.locale}"/>

</h:head>
<h:body>
    <ui:decorate template="/sample.xhtml">
        <ui:define name="body">

            <h:form>
                <!--Выбор страны-->

                    Выбор страны <br/>
                    <h:selectOneMenu value="#{weather.countriesUser}" onchange="submit()"
                                     valueChangeListener="#{weather.countrySet}" >
                        <f:selectItems value="#{weather.countriesList}" var="y"
                                       itemLabel="#{y.name}" itemValue="#{y.name}" />
                    </h:selectOneMenu>


                <!--После того как выбрали старну, выбираем город-->


                    Выбор города <br/>
                    <h:selectOneMenu value="#{weather.citiesUser}" onchange="submit()"
                                     valueChangeListener="#{weather.CitiesSet}"        >
                        <f:selectItems value="#{weather.citiesList}" var="r"
                                       itemLabel="#{r.value}" itemValue="#{r.id}" />
                    </h:selectOneMenu>



            </h:form>
          <h:form>
              Введенные вами параметры:<br/>
              <h:outputText value="Страна : #{weather.countriesUser}"/><br/>
              <h:outputText value="Область : #{weather.forecast.part}"/> <br/>
              <h:outputText value="Город : #{weather.forecast.city}"/><br/>
              <h:outputText value="id Города :  #{weather.citiesUser}"/><br/>
              <h:outputText value="****************************************************"/><br/>
              <h:dataTable value="#{weather.forecast.day}" var="item"
                           styleClass="order-table"
                           headerClass="order-table-header"
                           rowClasses="order-table-odd-row,order-table-even-row"
                      >


                    <h:column>
                        <f:facet name="header" >
                           Дата
                        </f:facet>
                        #{item.date}
                    </h:column>

                  <h:column>

                      <h:dataTable value="#{item.hour}" var="d"  styleClass="order-table"
                                   headerClass="order-table-header"
                                   rowClasses="order-table-odd-row,order-table-even-row">
                          <h:column>
                              <f:facet name="header" >
                                  <h:outputText value="Время" />
                              </f:facet>
                              #{d.at} :00
                          </h:column>
                        <h:column>
                            <f:facet name="header" >
                                <h:outputText value="Погода" />
                            </f:facet>
                            #{d.temperature}
                        </h:column>
                      </h:dataTable>

                  </h:column>


                    </h:dataTable>


          </h:form>




        </ui:define>
    </ui:decorate>


</h:body>


</html>



